#include <stdio.h>
#include <string.h>

int k1, k2, k3;
typedef struct
{
    char ch;
    int pre, next;
}encode;
encode code[90];
char instr[90];
int h1, h2, h3, n1, n2, n3;
void findgroup()
{
    int i, len; 
    char ch;
    len = strlen(instr);
    h1=h2=h3=-1;
    n1=n2=n3=0;
    for (i=0; i<len; ++i)
    {
        ch = instr[i];
        if (ch>='a' && ch<='i')
        {
            code[i].ch = ch;
            code[i].pre = n1;
            code[n1].next = i;
            n1 = i;
            if (h1==-1) h1=i;
        }
        else if (ch>='j' && ch<='r')
        {
            code[i].ch = ch;
            code[i].pre = n2;
            code[n2].next = i;
            n2 = i;
            if (h2==-1) h2=i;
        }
        else 
        {
            code[i].ch = ch;
            code[i].pre = n3;
            code[n3].next = i;
            n3 = i;
            if (h3==-1) h3=i;
        }            
    }    
    code[n1].next = h1;
    code[h1].pre = n1;
    code[n2].next = h2;
    code[h2].pre = n2;
    code[n3].next = h3;
    code[h3].pre = n3;    
    
}    
void roll()
{
    int i, j, jj, k;
    int ch;
    if (h1!=-1)
    for (k=1; k<=k1; ++k)
    {
        ch = code[n1].ch;
        j = n1;
        while (j!=h1)
        {
            jj = code[j].pre;
            code[j].ch = code[jj].ch;
            j =  jj;
        }    
        code[h1].ch=ch;
    }    
    if (h2!=-1)
    for (k=1; k<=k2; ++k)
    {
        ch = code[n2].ch;
        j = n2;
        while (j!=h2)
        {
            jj = code[j].pre;
            code[j].ch = code[jj].ch;
            j =  jj;
        }    
        code[h2].ch=ch;
    }    
    if (h3!=-1)
    for (k=1; k<=k3; ++k)
    {
        ch = code[n3].ch;
        j = n3;
        while (j!=h3)
        {
            jj = code[j].pre;
            code[j].ch = code[jj].ch;
            j =  jj;
        }    
        code[h3].ch=ch;
    }    

}    
void output()
{
    int i, len;
    len=strlen(instr);
    for (i=0; i<len; ++i)
        printf("%c", code[i].ch);
    printf("\n");
}    

int main()
{
    while (1)
    {
        scanf("%d%d%d", &k1, &k2, &k3);
        if (k1==0 && k2==0 && k3==0) break;
        memset(code, 0, sizeof(code));
        scanf("%s", instr);
        findgroup();
        /*/ check group
        for (int i=0; i<strlen(instr); ++i)
                printf("No.%d code=%c pre=%d next=%d\n", i, code[i].ch, code[i].pre, code[i].next);
        printf("\n");
        // check group*/
        roll();
        output();
        
    }    
    
    
    return 0;
}    